<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>单选复选样式</title>
    <style>
        * {

            box-sizing: border-box;
        }

        input[type="checkbox"]+label::before {
            content: "\a0";
            /*不换行空格*/
            display: inline-block;
            vertical-align: .2em;
            width: .8em;
            height: .8em;
            margin-right: .2em;
            border-radius: .2em;
            background-color: #FFF;
            border: 2px solid #8FDB8C;
            text-indent: .15em;
            line-height: .65;
            /*行高不加单位，子元素将继承数字乘以自身字体尺寸而非父元素行高*/
        }

        input[type="checkbox"]:checked+label::before {
            content: "\2713";
            background-color: #e7e7e7;
        }

        input {
            position: absolute;
            clip: rect(0, 0, 0, 0);
        }
        /*  input[type="checkbox"]:focus+label::before {
            box-shadow: 0 0 .1em .1em #58a;
        } */

        input[type="checkbox"]:disabled+label::before {
            background-color: #D6CBCB;
            box-shadow: none;
            color: #F03030;
        }
        /*性别*/

        .sex span.warning {
            font-size: 1.4rem;
            color: #ccc;
        }

        .sex .male,
        .sex .female {
            position: relative;
            width: 4rem;
            height: 3.9rem;
            z-index: 1;
            line-height: 3.9rem;
            text-align: center;
        }

        .sex .male label,
        .sex .female label {
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            width: 4rem;
            height: 3.9rem;
            z-index: 3;
            opacity: 0;
            margin: auto;
            display: inline-block;
            line-height: 3.9rem;
            cursor: pointer;
        }

        .sex input {
            display: inline-block;
            vertical-align: middle;
            /*让默认的单选样式的圆圈和“男”“女”的文本没有高差，看起来在同一水平线*/
            height: 2.8rem;
            line-height: 2.8rem;
            margin: 0;
            /*清除浏览器默认的外边距*/
        }

        .sex .male span.btn,
        .sex .female span.btn {
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            width: 4rem;
            height: 2.8rem;
            z-index: 2;
            margin: auto;
            display: inline-block;
            line-height: 2.6rem;
            text-align: center;
            border: .1rem solid #fe5454;
            color: #fe5454;
        }

        .sex .male span {
            border-top-left-radius: .2rem;
            border-bottom-left-radius: .2rem;
        }

        .sex .female span {
            border-top-right-radius: .2rem;
            border-bottom-right-radius: .2rem;
        }

        .sex .male span.active,
        .sex .female span.active {
            background-color: #fe5454;
            color: #fff;
        }
    </style>
</head>

<body>
    <p>自定义</p>
    <div>
        <input type="checkbox" id="awesome" />
        <label for="awesome">Awesome!</label>
        <input type="checkbox" id="awesome2" disabled />
        <label for="awesome2">Awesome2!</label>
    </div>
    <div>
        <div class="sex">
            <span class="warning fl">性别确定后将不可更改！</span>
            <div class="select fr">
                <div class="male fl">
                    <label for="male">                        
                                <input type="radio" name="sex" id="male" checked>男
                            </label>
                    <span class="btn active">男</span>
                </div>
                <div class="female fl">
                    <label for="female">
                                <input type="radio" name="sex" id="female">女
                            </label>
                    <span class="btn">女</span>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript">
        $(".select label").click(function () {
            $(this).siblings("span").addClass("active");
            $(this).parent().siblings("div").find("span").removeClass("active");
        });
    </script>
</body>

</html>